<?php
function getVATpayment(){
    if(file_exists('data/configfiles/vat.inc')) return file_get_contents('data/configfiles/vat.inc');
    if(file_exists('../data/configfiles/vat.inc')) return file_get_contents('../data/configfiles/vat.inc');
    if(file_exists('../../../data/configfiles/vat.inc')) return file_get_contents('../../../data/configfiles/vat.inc');
    if(file_exists('../../../../data/configfiles/vat.inc')) return file_get_contents('../../../../data/configfiles/vat.inc');
    return 'NO';
}
function getUsingUnitInput(){
    if(file_exists('data/configfiles/inpuunit.inc')) return file_get_contents('data/configfiles/inpuunit.inc');
    if(file_exists('../data/configfiles/inpuunit.inc')) return file_get_contents('../data/configfiles/inpuunit.inc');
    if(file_exists('../../../data/configfiles/inpuunit.inc')) return file_get_contents('../../../data/configfiles/inpuunit.inc');
    return 'NO';
}
function getSendOrderWithoutRegistring(){
    if(file_exists('data/configfiles/order.inc')) return file_get_contents('data/configfiles/order.inc');
    if(file_exists('../data/configfiles/order.inc')) return file_get_contents('../data/configfiles/order.inc');
    if(file_exists('../../../data/configfiles/order.inc')) return file_get_contents('../../../data/configfiles/order.inc');
    return 'NO';
}
function getEnableUserOrdering(){
    if(file_exists('data/configfiles/userordering.inc')) return file_get_contents('data/configfiles/userordering.inc');
    if(file_exists('../data/configfiles/userordering.inc')) return file_get_contents('../data/configfiles/userordering.inc');
    if(file_exists('../../../data/configfiles/userordering.inc')) return file_get_contents('../../../data/configfiles/userordering.inc');
    return 'NO';
}
function getEnableProductCodeShowing(){
    if(file_exists('data/configfiles/productcode.inc')) return file_get_contents('data/configfiles/productcode.inc');
    if(file_exists('../data/configfiles/productcode.inc')) return file_get_contents('../data/configfiles/productcode.inc');
    if(file_exists('../../../data/configfiles/productcode.inc')) return file_get_contents('../../../data/configfiles/productcode.inc');
    return 'NO';
}
function getEnableFastSearch(){
    if(file_exists('data/configfiles/fastsearch.inc')) return file_get_contents('data/configfiles/fastsearch.inc');
    if(file_exists('../data/configfiles/fastsearch.inc')) return file_get_contents('../data/configfiles/fastsearch.inc');
    if(file_exists('../../../data/configfiles/fastsearch.inc')) return file_get_contents('../../../data/configfiles/fastsearch.inc');
    return 'NO';
}
//---------------------------------------------
//system preferences
//local variables and options
define('_DB_SERVER_LOCAL_DATE_FORMAT_','Y-m-d');
define('_ITEMS_COUNT_IN_SINGLE_PAGE_','4');
define('_MAXIMUM_PAGES_COUNT_','4');
define('_ESHOP_VERSION_NO_','beta 0.2.9.2');
//dirs and files
define('_TEMPLATE_DIR_','templates');
define('_I18N_DIR_','i18n');	
define('_PRODUCTS_IMAGE_DIR_','data/images');
define('_PREVIEW_IMAGE_SUFFIX_','mini');
define('_IMAGES_FILE_TYPE_','.jpg');
define('_SYSTEM_SUBDIRS_','/netbeans/obchod/');
//identificators
define('_SESS_PREFIX_','betashop');
define('_SESS_IP_PROTECTION_','NO');  //not implemented, yet
define('_SESS_USER_','user');
define('_SESS_USER_DATA_','user_temp_data'); //it will be used, if _SEND_ORDER_WITHOUT_REGISTRING_ is set to YES
//products
define('_VAT_',getVATpayment()); //YES or NO
define('_USER_ORDERING_',getEnableUserOrdering()); //YES or NO
define('_USE_INPUT_FOR_DEFINING_COUNT_TO_PUT_TO_BASKET_',getUsingUnitInput()); //YES or NO
define('_PRODUCT_CODE_SHOWING_',getEnableProductCodeShowing()); //YES or NO
define('_PRODUCTS_COUNT_IN_SINGLE_LINE_','2');
define('_TEXTS_LENGHT_IN_PREVIEW_','100');
define('_PREVIEW_IMAGE_MAX_WIDTH_',70); //in px
define('_PREVIEW_IMAGE_MAX_HEIGHT_',70); //in px
define('_IMAGE_MAX_WIDTH_',640); //in px
define('_IMAGE_MAX_HEIGHT_',480); //in px
define('_FAST_SEARCH_SHOWING_',getEnableFastSearch()); //YES or NO
//user
define('_EXPIRATION_OF_GENERATED_PASSWORD_IN_DAYS_',5);
define('_LENGTH_OF_GENERATED_PASSWORD_',5); //max 10 chars
define('_USER_TEMP_DATA_ITEM_DELIMITER_','-+-');
define('_USER_TEMP_DATA_INDEX_VALUE_DELIMITER_','|*|');
//order
define('_SEND_ORDER_WITHOUT_REGISTRING_',getSendOrderWithoutRegistring()); //YES or NO
//---------------------------------------------	
//URL
//names of url variables
define('_URL_INACTIVE_ADDR_','javascript:');
define('_URL_VARIABLE_MENU_','menu');
define('_URL_VARIABLE_PRODUCT_','product');
define('_URL_VARIABLE_FILE_','link');
define('_URL_VAL_DELIMITER_',';');
define('_URL_USE_REWRITE_ENGINE_','YES'); //values YES or NO
//default values of URL
define('_DEFAULT_URL_MENU_','def'._URL_VAL_DELIMITER_.'def'); 				//top_menu*|*category_menu
define('_DEFAULT_URL_PRODUCT_','name'._URL_VAL_DELIMITER_.'0'._URL_VAL_DELIMITER_.'0');	//ordering*|*category*|*product  ... ordering:name,name_desc,price,price_desc
define('_DEFAULT_URL_FILE_','def');                                                     //filename to show into flow DIV
//---------------------------------------------
//database
define('_DB_NAME_','test1');
define('_DB_HOST_','localhost');
define('_DB_USER_','root');
define('_DB_PSSWD_','');
//---------------------------------------------
//imageviewer
//photoalbums and image files
define('_IMAGEVIEWER_INFO_XML_FILENAME_', 'info.xml');
//---------------------------------------------
//internal service
define('_GET_TEMPLATE_FROM_COOKIE_','YES'); //values YES or NO
define('_TEMPLATE_COOKIE_NAME_','tempcookie');
define('_TEMPLATE_URL_NAME_','tmpcknm');
define('_DBG_MODE_','NO'); //values YES or NO
?>